package mcsm.OperationCenter;

import mcsm.DataBaseIntegration.StaffLoginConnect;
import mcsm.DataBaseIntegration.VIPLoginConnect;
import mcsm.Model.Person;
import mcsm.OperationCenter.InterfaceCenter.LoginFunction;
import mcsm.DataBaseIntegration.*;
import mcsm.DataBaseInterface.Connector;

public class Login{
	DataBaseConnect database;
	Connector connector;

	public Login() {
		database = DataBaseConnect.getDatabase();
	}

	public Person login(String ID, String password, int choice) {
		switch (choice) {
		case 0:
			connector = new VIPLoginConnect(ID, password);
			break;
		case 1:
			connector = new StaffLoginConnect(ID, password);
			break;
		default:
			break;
		}
		return (Person) database.connect(connector);
	}
}